home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
arexx
/
rxcmanager
/
examples
/
cmanager_useraddress.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-25
|
2KB
|
119 lines
/*
** $VER: CManager_UserAddress.rexx 1.001 (25.04.99) © Simone Tellini
**
**
** FUNCTION:
** Searches USERS in CManager and copies them in GoldED
**
** $HISTORY:
**
** 25 Apr 1999 : 001.001 : By Giangi, adapted to GoldED v3 and modified a
** bit the output
**
*/
options results /* enable return codes */
if (left(address(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
/* 'LOCK CURRENT RELEASE=4' */ /* lock GUI, gain access */
'LOCK CURRENT' /* lock GUI, gain access */
if (RC ~= 0) then exit
options failat 6 /* ignore warnings */
signal on syntax /* ensure clean exit */
/* ---------------------- INSERT YOUR CODE HERE ---------------------- */
if ~show("L","rxcmanager.library") then
if ~addlib("rxcmanager.library",0,-30) then do
say "no rxcmanager.library"
exit
end
parse arg Search
if Search = 'search' then do
'REQUEST STRING TITLE="Enter the name of the user to search for:" VAR=K'
patt.Name = '#?'k'#?'
patt.LastName = '#?'k'#?'
num = CMFind("USER","REC","PATT",1)
end
else do
call CMStart()
num = CMGetEntry("USER MULTISELECT","REC")
call CMClose()
end
if num > 0 then do
do i=0 to num-1
'CR'
'FIRST'
'TEXT T="'rec.i.Name' 'rec.i.LastName' mailto:'rec.i.EMail'"'
'CR'
'FIRST'
if rec.i.Address ~= '' then do
addr = rec.i.Address
newline = index( addr, '0a'x )
do while newline ~= 0
'TEXT T="'left( addr, newline - 1 )'"'
'CR'
'FIRST'
addr = right( addr, length( addr ) - newline )
newline = index( addr, '0a'x )
end
'TEXT T="'addr'"'
'CR'
'FIRST'
end
if rec.i.ZIP ~= '' || rec.i.City ~= '' then do
space = 0
if rec.i.ZIP ~= '' then do
'TEXT T="'rec.i.ZIP'"'
space = 1
end
if rec.i.City ~= '' then do
if space then 'TEXT T=" "'
'TEXT T="'rec.i.City'"'
end
'CR'
'FIRST'
end
if rec.i.Country ~= '' then do
'TEXT T="'rec.i.Country'"'
'CR'
'FIRST'
end
end
end
/* ------------------------- END OF YOUR CODE ------------------------ */
'UNLOCK' /* unlock GUI */
exit
SYNTAX:
SAY "Error in line" SIGL ":" ERRORTEXT(RC)
'UNLOCK'